package com.example.dbmysql.mapper;


import com.example.dbmysql.pojo.Configuration;
import com.example.dbmysql.result.Result;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ConfigurationMapper {

    @Insert("insert into configuration(check_out_time,stay_day,hourly_room,Check_out_configuration,time_clean,timeout_fake_lock,locked,mute,source,default_name,default_phone,create_timer,update_timer)"+"" +
            "values (#{checkOutTime},#{stayDay},#{hourlyRoom},#{CheckOutConfiguration},#{timeClean},#{timeoutFakeLock},#{locked},#{mute},#{source},#{defaultName},#{defaultPhone},now(),now())")
    void edit(Configuration configuration);

    @Select("select  * from  configuration")
    Configuration select();

    @Update("update  configuration set check_out_time=#{checkOutTime},stay_day=#{stayDay},hourly_room=#{hourlyRoom},Check_out_configuration=#{checkOutConfiguration},time_clean=#{timeClean},timeout_fake_lock=#{timeoutFakeLock},locked=#{locked},mute=#{mute},source=#{source},default_name=#{defaultName},default_phone=#{defaultPhone},update_timer=#{updateTimer}")
    void update(Configuration configuration);
}
